package zelix.command;

import zelix.utils.Wrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.network.play.client.CPacketPlayer;

public class TP extends Command
{
	public TP()
	{
		super("tp");
	}

	@Override
	public void runCommand(String s, String[] args)
	{

		if(args[0] != null && args[1] != null && args[2] != null){
			int x = Integer.parseInt(args[0]);
			int y = Integer.parseInt(args[1]);
			int z = Integer.parseInt(args[2]);
			Minecraft.getMinecraft().player.setPosition(x,y,z);
			Wrapper.INSTANCE.sendPacket(new CPacketPlayer.Position(x, y, z, Wrapper.INSTANCE.player().onGround));
		}
	}

	@Override
	public String getDescription()
	{
		return "TP Anywhere";
	}

	@Override
	public String getSyntax()
	{
		return "tp <X> <Y> <Z>" + "" + "tp <PlayerID>";
	}

	//等等写 tp playerID
}